using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Scene;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.Page
{
	public class ScrollPicListPage : BasePage
	{
		private const string TAG = "ScrollPicListPage";
		private EventWatcher mWatchxxx;
		private object mObjectWatcher;
		internal Grid LayoutRoot;
		private bool _contentLoaded;
		public ScrollPicListPage()
		{
			this.InitializeComponent();
			ScrollPicListCtrl instance = ScrollPicListCtrl.getInstance();
			if (instance.get_Parent() != null)
			{
				Panel panel = instance.get_Parent() as Panel;
				panel.get_Children().Remove(instance);
			}
			instance.gridLayoutRoot.set_Background(null);
			this.LayoutRoot.get_Children().Add(instance);
			base.add_Loaded(new RoutedEventHandler(this.Page_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.Page_Unloaded));
		}
		private void Page_Loaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("ScrollPicListPage", "Page_Loaded");
		}
		private void Page_Unloaded(object sender, RoutedEventArgs e)
		{
			Log.smethod_5("ScrollPicListPage", "Page_Unloaded");
		}
		protected override void OnPageIn(object[] object_0)
		{
			Log.smethod_5("ScrollPicListPage", "OnPageIn");
			if (object_0 != null && object_0.Length != 0)
			{
				if (object_0[0].GetType() == typeof(ScrollPicsCtrlArgs))
				{
					ScrollPicsCtrlArgs args = object_0[0] as ScrollPicsCtrlArgs;
					ScrollPicListCtrl instance = ScrollPicListCtrl.getInstance();
					instance.SetArgs(args);
					instance.Start();
					return;
				}
			}
		}
		protected override void OnPageOut()
		{
			Log.smethod_5("ScrollPicListPage", "OnPageOut");
		}
		protected override void OnPageBack()
		{
			Log.smethod_5("ScrollPicListPage", "OnPageBack");
		}
		private void registerEvent()
		{
			if (this.mWatchxxx == null)
			{
				this.mWatchxxx = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.Onxxx));
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchxxx);
			}
		}
		private void unRegisterEvent()
		{
			if (this.mWatchxxx != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatchxxx);
				this.mWatchxxx = null;
			}
		}
		private void Onxxx(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (evtArgs == null)
			{
				return;
			}
		}
		private void initUI()
		{
		}
		protected override void OnBackKeyPress(CancelEventArgs cancelEventArgs_0)
		{
			cancelEventArgs_0.set_Cancel(true);
		}
		private object scrollPicEnded(object obj1, object obj2)
		{
			base.GoBack();
			return null;
		}
		public static void GotoThisPage(ScrollPicsCtrlArgs args, Panel panelHolder = null)
		{
			if (args == null)
			{
				return;
			}
			ServiceCenter.statReportMgr.addStatItem(enKVStatKey.MM_SNS_CHECK_BIGPIC, "1");
			if (panelHolder == null && args.mPanelHolder == null)
			{
				ToolFunction.GotoPageForUserControl("/Source/Plugin/Sns/Circle/UI/ScrollPicListPage.xaml", new object[]
				{
					args
				}, false);
				return;
			}
			if (args.mPanelHolder == null)
			{
				args.mPanelHolder = panelHolder;
			}
			ScrollPicListCtrl instance = ScrollPicListCtrl.getInstance();
			if (instance.get_Parent() != null)
			{
				Panel panel = instance.get_Parent() as Panel;
				panel.get_Children().Remove(instance);
			}
			instance.SetArgs(args);
			panelHolder.get_Children().Add(instance);
			instance.Start();
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/Sns/Circle/UI/ScrollPicListPage.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
		}
	}
}
